package com.framework.model.system;

import com.framework.common.annotation.QueryParam;
import com.framework.common.model.validation.ValidationGroup;
import com.framework.model.base.BaseModel;
import java.io.Serializable;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * @author 龘鵺
 * @version 1.0
 * @className com.framework.model.system.SystemLog
 * @title 系统管理操作日志类
 * @datetime 2024-06-19 09:34:28
 */
public class SystemLog extends BaseModel implements Serializable {
    /**
     * 帐号 ACCOUNT
     */
    @NotBlank(message = "请输入帐号", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Size(message = "帐号最多32字符", max = 32, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "account", code = "p.ACCOUNT")
    private String account;

    /**
     * IP地址 IP
     */
    @NotBlank(message = "请输入IP地址", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Size(message = "IP地址最多256字符", max = 256, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "ip", code = "p.IP")
    private String ip;

    /**
     * 操作标题 OPERATER_TITLE
     */
    @NotBlank(message = "请输入操作标题", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Size(message = "操作标题最多256字符", max = 256, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "operaterTitle", code = "p.OPERATER_TITLE")
    private String operaterTitle;

    /**
     * 操作内容 OPERATER_CONTENT
     */
    @NotBlank(message = "请输入操作内容", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Size(message = "操作内容最多2000字符", max = 2000, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "operaterContent", code = "p.OPERATER_CONTENT")
    private String operaterContent;

    /**
     * system_log
     */
    private static final long serialVersionUID = 1L;

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account == null ? null : account.trim();
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip == null ? null : ip.trim();
    }

    public String getOperaterTitle() {
        return operaterTitle;
    }

    public void setOperaterTitle(String operaterTitle) {
        this.operaterTitle = operaterTitle == null ? null : operaterTitle.trim();
    }

    public String getOperaterContent() {
        return operaterContent;
    }

    public void setOperaterContent(String operaterContent) {
        this.operaterContent = operaterContent == null ? null : operaterContent.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", account=").append(account);
        sb.append(", ip=").append(ip);
        sb.append(", operaterTitle=").append(operaterTitle);
        sb.append(", operaterContent=").append(operaterContent);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SystemLog other = (SystemLog) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getOperaterId() == null ? other.getOperaterId() == null : this.getOperaterId().equals(other.getOperaterId()))
            && (this.getOperaterTime() == null ? other.getOperaterTime() == null : this.getOperaterTime().equals(other.getOperaterTime()))
            && (this.getAccount() == null ? other.getAccount() == null : this.getAccount().equals(other.getAccount()))
            && (this.getIp() == null ? other.getIp() == null : this.getIp().equals(other.getIp()))
            && (this.getOperaterTitle() == null ? other.getOperaterTitle() == null : this.getOperaterTitle().equals(other.getOperaterTitle()))
            && (this.getOperaterContent() == null ? other.getOperaterContent() == null : this.getOperaterContent().equals(other.getOperaterContent()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getOperaterId() == null) ? 0 : getOperaterId().hashCode());
        result = prime * result + ((getOperaterTime() == null) ? 0 : getOperaterTime().hashCode());
        result = prime * result + ((getAccount() == null) ? 0 : getAccount().hashCode());
        result = prime * result + ((getIp() == null) ? 0 : getIp().hashCode());
        result = prime * result + ((getOperaterTitle() == null) ? 0 : getOperaterTitle().hashCode());
        result = prime * result + ((getOperaterContent() == null) ? 0 : getOperaterContent().hashCode());
        return result;
    }
}